/**
 * Created by Jay on 2016/6/16.
 */

function edit_userLicense(){
    if(check_reload==1){
        check_reload=2;
        parent.location.reload();
        //cnsole.log(check_reload);
    }
    $("body").off();
    //mccmsa.hashChange();
    var ue = UE.getEditor('editor');
        mccmsa.ajax({
            url: "userLicenseController/checkLicense",
            method: "get",
            success: function (data) {
                //history.go(0);
                setTimeout(function(){
                    ue.ready(function() {
                        ue.setContent(data.result);
                    });
                },1000);
                //$("body .view")[0].innerHTML(data.result);
            }
        })

    //parent.location.reload();
    $(".save").on("click",function(){
        var data=UE.getEditor('editor').getContent();
        if(data==""){
            layer.alert("输入为空");
            return;
        }
        mccmsa.ajax({
            url: "userLicenseController/updateLicense",
            method: "POST",
            data: {license:data},
            success: function (data) {
                //console.log(data);
                if(!data.status==200) {
                    layer.alert(data.message);
                    return;
                }
                layer.alert("更改成功");
            }
        })
    })

}